/**
 * Fuzzy Refrigerator: Refrigerator with Fuzzy Logic as temperature controller
 * Copyright (C) 2012  Izwan Azmi
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

 /**
  * @file refrigerator.h
  * @brief
  * @author Izwan Azmi <izwanazmi90@gmail.com>
  */

#ifndef REFRIGERATOR_H
#define REFRIGERATOR_H

#include "mamdani.h"

typedef struct
{
    trapezoid panas;
    trapezoid ideal;
    trapezoid sejuk;
} temp;

typedef struct
{
    trapezoid lajuN;
    trapezoid lajuP;
    trapezoid perlahan;
} rate_change_temp;

typedef struct
{
    trapezoid lemah;
    trapezoid sederhana;
    trapezoid kuat;
} power;

typedef struct
{
    temp suhu;
    rate_change_temp rate;
    power pow;
} pembolehubah_linguistik;

class refrigerator : public mamdani
{
    public:
        refrigerator();
        virtual ~refrigerator();
        float start(float, float);
        void report(int);
    protected:
    private:
        pembolehubah_linguistik ref;
        float sejuk, ideal, panas;
        float perlahan, laju;
        float lemah, sederhana[3], kuat[2];
        float maxNumVarOut[1];
        float input[2];
};

#endif // REFRIGERATOR_H
